ACTOR DualSMG : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip1"
	Weapon.AmmoType2 "BDDualSMGAmmo"
	Obituary "%o was shot down by %k's SMG."
    AttackSound "None"
    Inventory.PickupSound "CLIPIN"
	Inventory.ForbiddenTo Corvus
	Inventory.Pickupmessage "You got the SMG! (Slot 2)"
    +WEAPON.NOAUTOAIM
    //+WEAPON.NOAUTOFIRE
    +FORCEXYBILLBOARD
	+WEAPON.NO_AUTO_SWITCH
	Scale 0.9
	Tag "Dual SMGs"
	States
	{
	
		Spawn:
			TNT1 A 100//Pickup sprite
			Loop
		Fire:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
			SLMP C 0 A_JumpIfInventory("IsPaladin",1,2)
			SLMG C 0
			"####" C 1 //A_WeaponReady(WRF_NOFIRE)
			TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
			TNT1 A 0 A_Refire
			Goto ReadyToFire
		SelectAnimation:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("CLIPIN", 1)
			TNT1 A 0
			TNT1 A 0 A_TakeInventory("StopDualWield", 1)
			TNT1 A 0 A_PlaySound("CLIPIN", 3)
			PSMS F 0 A_JumpIfInventory("IsPaladin",1,2)
			SMSE F 0
			"####" FEDCBA 1
			TNT1 A 0 A_GunFlash
		Ready:	
		Ready3:
		ReadyToFire:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
			SLMP C 0 A_JumpIfInventory("IsPaladin",1,2)
			SLMG C 0
			"####" C 1 A_WeaponReady// Weapon is ready to fire
			//TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, 1)
			//TNT1 A 0 A_GunFlash
			TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
			TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload2") //Check if player wants to reload
			TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
			TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
			TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
			"####" F 0 A_JumpIfInventory("Quickspell",1,"Quickspell")
			TNT1 A 0 A_JumpIfInventory("IsPaladin",1,3)
			TNT1 A 0 A_SetCrosshair(14)
			TNT1 A 0 A_Jump(256,2)
			TNT1 A 0 A_SetCrosshair(13)
			TNT1 A 0
			Loop
		DualWield:
			PSMS A 0 A_JumpIfInventory("IsPaladin",1,2)
			SMSE A 0
			"####" ABCDEF 1
			DURI A 0
			DURI A 0 A_Takeinventory("StartDualWield",1)
			DURI A 0 A_SelectWEapon("Schism_SMG")
			Goto Ready	
		Deselect:
			TNT1 A 0 A_Lower
			Loop
		Select:
			//TNT1 A 0 A_Raise //Makes the weapon always be selected fast
			//Wait
			TNT1 AAAAAAAAAAAA 0 A_Raise
			TNT1 A 1 A_Raise
			Goto SelectAnimation
		SpellFlash:
			MSSF AAABBBCCCCCCCCCCCCCCCBBBAAAA 1
			stop
		DryFire:
			P2W2 A 0 A_PlaySound("DRYFIRE", 1)
			SLMP C 0 A_JumpIfInventory("IsPaladin",1,2)
			SLMG C 0
			"####" C 10
			Goto ReadyToFire
		FireLeftGun:
			P2W2 A 0
			TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 1, 1)//First of all, checks if there is ammo inside the gun
			Goto Reload//Couldn't find any ammo. Reload
			
			TNT1 A 0 A_JumpIfInventory("LeftSMGAmmo", 1, 1)//Checks if there is ammo inside the left Rifle
			Goto DryFire//Couldn't find any ammo. Don't fire.
			
			TNT1 A 0 A_TakeInventory("BDDualSMGAmmo", 1)//Removes 1 ammo from magazine
			TNT1 A 0 A_AlertMonsters
			TNT1 A 0 A_FireCustomMissile("Tracer", random(-4,4), 0, -6, -2, 0, random(-2,2))
			RIFF A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, -5, 0, 0, 0)
			SMGG A 0 A_PlaySound("FARSHT", 6)
			SMGG A 0 A_PlaySound("SMGFIRE", 1)
			SLMG A 0 A_JumpIfInventory("IsPaladin",1,3)
			SLMG A 1 BRIGHT A_FireBullets(12,3.5,-1,17,"WeakPuff", FBF_NORANDOM)//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
			SLMG A 0 A_Jump(256,2)
			SLMP A 1 BRIGHT A_FireBullets (3.5, 3.5, 1, 17, "WeakPuff", FBF_NORANDOM)
			TNT1 A 0 A_SetPitch(+0.6 + pitch)//Vertical recoil up
			SLMP B 0 A_JumpIfInventory("IsPaladin",1,2)
			SLMG B 0
			"####" B 1 A_FireCustomMissile("PistolCaseSpawn",0,0,-20,-10) //Ejetts empty brass
			"####" C 0 A_SetPitch(-0.6 + pitch)//Vertical recoil down
			"####" C 1 A_TakeInventory("LeftSMGAmmo", 1)//Remove the fake ammo
			TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 1, 1)//Checks if there is ammo inside the gun
			Goto Reload//Couldn't find any ammo. Reload.
			SLMG C 0
			TNT1 A 0 A_JumpIfInventory("LeftSMGAmmo", 1, 1)//Checks if there is ammo inside the left Rifle
			Goto DryFire//Couldn't find any ammo. Don't fire.
			TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player still is firing left gun
			P2W2 A 0
			Goto Fire//No need to reload. Get back to Ready state.
		
		Flash:	
			TNT1 A 0
			TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
			TNT1 A 0 A_JumpIfInventory("TossGrenade", 1, "GoAway")
			SRMP C 0 A_JumpIfInventory("IsPaladin",1,2)
			SRMG C 0
			"####" C 1
			TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
			TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"GoAway")
			//P2W1 A 1
			Loop
			GoAway:
			TNT1 A -1
			Stop
		DontFlash:
			TNT1 A 1
			Goto Flash
	
		FireRightGun:
			P2W1 A 0
			TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
			TNT1 A 0 A_GiveInventory("IsFiringSecondary", 1)
			TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 1, 2)//First of all, checks if there is ammo inside the gun
			TNT1 A 0 //A_GiveInventory("Reloading", 1)//Couldn't find any ammo. Reload
			Goto Flash//Couldn't find any ammo. Reload
			
			TNT1 A 0 A_JumpIfInventory("BDSMGAmmo", 1, 1)//Checks if there is ammo inside the left Rifle
			Goto DryFire2//Couldn't find any ammo. Don't fire.
			
			TNT1 A 0 A_TakeInventory("BDDualSMGAmmo", 1)//Removes 1 ammo from magazine
			
			TNT1 A 0 A_AlertMonsters
			TNT1 A 0 A_FireCustomMissile("Tracer", random(-4,4), 0, 6, -2, 0, random(-2,2))
			RIFF A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 5, 0, 0, 0)
			SMGG A 0 A_PlaySound("FARSHT", 6)
			SMGG A 0 A_PlaySound("SMGFIRE", 1)
			SRMG A 0 A_JumpIfInventory("IsPaladin",1,3)
			SRMG A 1 BRIGHT A_FireBullets(12,3.5,-1,17,"WeakPuff", FBF_NORANDOM)//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
			SRMG A 0 A_Jump(256,2)
			SRMP A 1 BRIGHT A_FireBullets (3.5, 3.5, 1, 17, "WeakPuff", FBF_NORANDOM)
			TNT1 A 0 A_SetPitch(+0.6 + pitch)//Vertical recoil up
			SRMP B 0 A_JumpIfInventory("IsPaladin",1,2)
			SRMG B 0
			"####" B 1 A_FireCustomMissile("PistolCaseSpawn",0,0,20,-10) //Ejetts empty brass
			"####" C 0 A_SetPitch(-0.6 + pitch)//Vertical recoil down
			"####" C 1 A_TakeInventory("BDSMGAmmo", 1)//Remove the fake ammo
			P2W1 A 0
			TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 1, 3)//Checks if there is ammo inside the gun
			TNT1 A 0 //A_GiveInventory("Reloading", 1)//Couldn't find any ammo. Reload
			TNT1 A 0 A_JumpIfInventory("BDSMGAmmo", 1, 1)//Checks if there is ammo inside the right Rifle
			Goto DryFire2//Couldn't find any ammo. Don't fire.
			SRMG C 0
			TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
			Goto Flash
		AltFire:
			TNT1 A 0
			Goto Fire
		DryFIre2:
			SRMG C 0 A_PlaySound("DRYFIRE", 1)
			SRMP C 0 A_JumpIfInventory("IsPaladin",1,2)
			SRMG C 0
			"####" CCCCCCCCCC 1 A_JumpIfInventory("StopDualWield", 1, "LightDone")
			Goto Flash
		
		
	TossGrenade:
		SMSE ABCDEF 1
		TNT1 A 0 A_SetCrosshair(41)
		WTFL A 0 A_JumpIfInventory("IsPaladin",1,"PallyGrenadeToss")
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 3)
		TNT1 A 0 A_Print("No Grenades Left.")
		//TNT1 A 0 A_Jump(256, "Ready")
		Goto SelectAnimation
		GRTH ABCD 1
		TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
		TNT1 A 0 A_Giveinventory("Punching",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_PLaySound ("GRNPIN")
		GRTH EEFG 1
		TNT1 A 0 A_PLaySound ("GRNTOSS")
		GRTH HI 1
		TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
		TNT1 A 0 A_FireCustomMissile("HandGrenade", random(-2,2), 0, 0, 0, 0, 0)
	    TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
		GRTH JKLM 1
		TNT1 A 1
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		Goto SelectAnimation
	PallyGrenadeToss:
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
		Goto PallyNoGrenade
		TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
		TNT1 A 0 A_PLaySound ("GRNPIN")
		TNT1 A 4 //wait a moment
		WTFL ABCDEF 1
		TNT1 A 0 A_PLaySound ("GRNTOSS")
		TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
		TNT1 A 0 A_FireCustomMissile("HandGrenade", random(-2,2), 0, 0, 0, 0, 0)
	    TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
		WTFL GHIJKL 1
		Goto SelectAnimation
	PallyNoGrenade:
		TNT1 A 0 A_Print("No Grenades Left.")
		//TNT1 A 0 A_Jump(256, "GoingToReady")
		Goto SelectAnimation
	Reload:
		TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 1, "Reload2")
	    TNT1 A 0 A_SetCrosshair(41)
	    SLMG C 1 //Always leave one free line before the reload animation to prevent bugs
		TNT1 A 0 A_TakeInventory("Reloading")//Always put this to make sure that the game understand that you already are reloading your weapon, and calling this state again is not necessary
		TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 80, "ReadytoFire")//Checks if the weapon is not fully reloaded, if yes, cancel reload.
		TNT1 A 0 A_PlaySound("DRYFIRE", 1)
		TNT1 A 0 A_JumpIfInventory("Clip1", 1, 1)//Checks if you have spare ammo
		Goto DryFire//Identified that you have no spare ammo. Get back to Ready animation
		TNT1 A 0 A_GiveInventory("StopDualWield", 1)
	Refill:	
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Clip1", 1, 1)//Check if you have spare ammo again. This line is necessary in case you don't have enough ammo to fill an entire clip.
		Goto FinishReload//Gun is fully loaded. Go to finish animation
	    TNT1 A 0 A_TakeInventorY("Clip1", 1)//Removes one spare bullet
		TNT1 A 0 A_GiveInventory("BDDualSMGAmmo", 1)//Puts one bullet inside the clip
		TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 80, "FinishReload")//Checks if weapons is full
		Loop
	 FinishReload:	//Weapon is fully loaded. Time to play the reloading animation.
		TNT1 A 0
		SMSE ABCDEF 1
		//TNT1 A 0 A_JumpIfInventory("LeftSMGAmmo", 40, "FinishReloadRight")
		//TNT1 A 0 A_JumpIfInventory("BDSMGAmmo", 40, "FinishReloadLeft")
		TNT1 A 0 A_GiveInventory("LeftSMGAmmo", 40)
		TNT1 A 0 A_GiveInventory("BDSMGAmmo", 40)
		TNT1 A 5
		TNT1 A 0 A_PlaySound("SMGMOUT", 1)//reload sound
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
		TNT1 A 0 A_FireCustomMissile("EmptyClipSpawn",185,0,8,-4)
		SM2R A 0 A_JumpIfInventory("IsPaladin",1,"PallyReloadAnimL1")	
		SM2R A 0 A_JumpIfInventory("IsSorcerer",1,"SorcyReloadAnimL1")
		SM2R A 0
		SM2R DEFGHIIIIII 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)
		SM2R JKLMNOPQRST 1	
		Goto ReloadAnimLEnded1
		
		PallyReloadAnimL1:
		PSLR GHIJKLMNOPQRSTUVWXYZ 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)
		PSLL ABCDEFGHIJKL 1
		Goto ReloadAnimLEnded1
		
		SorcyReloadAnimL1:
		SM2R DEFGHIIIIII 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)
		SM2R JKLMNOPQRST 1	
		
		ReloadAnimLEnded1:
		
		TNT1 A 10
		TNT1 A 0 A_PlaySound("SMGMOUT", 1)//reload sound
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
		TNT1 A 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)
		SMGR A 0 A_JumpIfInventory("IsPaladin",1,"PallyReloadAnimR1")	
		SMGR A 0 A_JumpIfInventory("IsSorcerer",1,"SorcyReloadAnimR1")
		SMGR A 0
		SMGR ABCCDDEEFFGHIIII 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)
        SMGR JKLMNOPQRST 1
		Goto ReloadAnimREnded1
		
		PallyReloadAnimR1:
		PSRR GHIJKLMNOPQRSTUVWXYZ 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)
		PSRL ABCDEFGHIJKL 1
		Goto ReloadAnimREnded1
		
		SorcyReloadAnimR1:
		SMGR ABCCDDEEFFGHIIII 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)
        SMGR JKLMNOPQRST 1
		
		ReloadAnimREnded1:
		
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
		TNT1 A 0 A_TakeInventory("FiredSecondary", 1)
		TNT1 A 5
		TNT1 A 0 A_TakeInventory("Reloading")//Always put this to make sure that the game understand that you already are reloading your weapon, and calling this state again is not necessary
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		Goto ReadyToFire
		
		
		
		
		//Reload 2 is for manual reload, leaves one more bullet inside the gun.
		
	Reload2:
	    TNT1 A 0 A_SetCrosshair(41)
	    SLMG C 1 //Always leave one free line before the reload animation to prevent bugs
		TNT1 A 0 A_TakeInventory("Reloading")//Always put this to make sure that the game understand that you already are reloading your weapon, and calling this state again is not necessary
		TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 82, "ReadytoFire")//Checks if the weapon is not fully reloaded, if yes, cancel reload.
		TNT1 A 0 A_JumpIfInventory("Clip1", 1, 1)//Checks if you have spare ammo
		Goto ReadyToFire//The game identified that you have no spare ammo. Get back to Ready animation
		TNT1 A 0 A_GiveInventory("StopDualWield", 1)
        
	Refill2:	
	    TNT1 A 0
		
		TNT1 A 0 A_JumpIfInventory("Clip1", 1, 1)//Check if you have spare ammo again. This line is necessary in case you don't have enough ammo to fill an entire clip.
	    Goto FinishReloadLeft
		TNT1 A 0 A_TakeInventorY("Clip1", 1)//Removes one spare bullet
		TNT1 A 0 A_GiveInventory("BDDualSMGAmmo", 1)//Puts one bullet inside the clip
		TNT1 A 0 A_JumpIfInventory("LeftSMGAmmo", 1, 2) //CHeck which gun is not empty, as Reload2 is the case for BDDualSMGAmmo >= 1
		TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 81, "FinishReloadLeft")
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo", 1, 2) //CHeck which gun is not empty, as Reload2 is the case for BDDualSMGAmmo >= 1
		TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 81, "FinishReloadLeft")
		TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo", 82, "FinishReloadLeft")//Checks if weapons is full
		Loop
		
		
		
		
	/*FinishReload2:	//Weapon is fully loaded. Time to play the reloading animation.
	    TNT1 A 0
		SMSE ABCDEF 1
		TNT1 A 0 A_JumpIfInventory("LeftSMGAmmo", 41, "FinishReloadRight")
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo", 41, "FinishReloadLeft")
		TNT1 A 0 A_GiveInventory("LeftSMGAmmo", 80)
		TNT1 A 0 A_GiveInventory("BDSMGAmmo", 80)
		TNT1 A 5
		TNT1 A 0 A_PlaySound("RELOAD", 1)//reload sound
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
		TNT1 A 0 A_FireCustomMissile("EmptyClipSpawn",185,0,8,-4)
		SM2R A 0 A_JumpIfInventory("IsPaladin",1,"PallyReloadAnimL2")	
		SM2R A 0 A_JumpIfInventory("IsSorcerer",1,"SorcyReloadAnimL2")
		SM2R A 0
		SM2R DEFGHIIIIIIJKLMNOPQRST 1	
		Goto ReloadAnimLEnded2
		
		PallyReloadAnimL2:
		PSLR GHIJKLMNOPQRSTUVWXYZ 1
		PSLL ABCDEFGHIJKL 1
		Goto ReloadAnimLEnded2
		
		SorcyReloadAnimL2:
		SM2R DEFGHIIIIIIJKLMNOPQRST 1	
		
		ReloadAnimLEnded2:
		TNT1 A 10
		TNT1 A 0 A_PlaySound("RELOAD", 1)//reload sound
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
		TNT1 A 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)
		SMGR A 0 A_JumpIfInventory("IsPaladin",1,"PallyReloadAnimR2")	
		SMGR A 0 A_JumpIfInventory("IsSorcerer",1,"SorcyReloadAnimR2")
		SMGR A 0
		SMGR ABCCDDEEFFGHIIII 1
        SMGR JKLMNOPQRST 1
		Goto ReloadAnimREnded2
		
		PallyReloadAnimR2:
		PSRR GHIJKLMNOPQRSTUVWXYZ 1
		PSRL ABCDEFGHIJKL 1
		Goto ReloadAnimREnded2
		
		SorcyReloadAnimR2:
		SMGR ABCCDDEEFFGHIIII 1
        SMGR JKLMNOPQRST 1
		
		ReloadAnimREnded2:
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
		TNT1 A 0 A_TakeInventory("FiredSecondary", 1)
		TNT1 A 5
		TNT1 A 0 A_TakeInventory("Reloading")//Always put this to make sure that the game understand that you already are reloading your weapon, and calling this state again is not necessary
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		Goto ReadyToFire	*/
		
		
	
	FinishReloadLeft:	//Weapon is fully loaded. Time to play the reloading animation.
		TNT1 A 0 A_JumpIfInventory("LeftSMGAmmo", 41, "FinishReloadRight")//Gun is fully loaded. Go to finish animation
		TNT1 A 0 A_GiveInventory("LeftSMGAmmo", 40)
		//TNT1 A 0 A_GiveInventory("BDSMGAmmo", 40)
		TNT1 A 5
		TNT1 A 0 A_PlaySound("SMGMOUT", 1)//reload sound
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
		TNT1 A 0 A_FireCustomMissile("EmptyClipSpawn",185,0,8,-4)
		SM2R A 0 A_JumpIfInventory("IsPaladin",1,"PallyReloadAnimLOnly")	
		SM2R A 0 A_JumpIfInventory("IsSorcerer",1,"SorcyReloadAnimLOnly")
		SM2R A 0
		SM2R DEFGH 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)//reload sound
		SM2R IIIIIIJKLMNOPQRST 1	
		Goto ReloadAnimLOnlyEnded
		
		PallyReloadAnimLOnly:
		PSLR GHIJKLMNOPQRSTUVWXYZ 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)//reload sound
		PSLL ABCDEFGHIJKL 1
		Goto ReloadAnimLOnlyEnded
		
		SorcyReloadAnimLOnly:
		SM2R DEFGH 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)//reload sound
		SM2R IIIIIIJKLMNOPQRST 1	
		
		ReloadAnimLOnlyEnded:
		
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
		TNT1 A 0 A_TakeInventory("FiredSecondary", 1)
		TNT1 A 5
		TNT1 A 0 A_TakeInventory("Reloading")//Always put this to make sure that the game understand that you already are reloading your weapon, and calling this state again is not necessary
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo", 41, 1)
		Goto FinishReloadRight
		TNT1 A 0 A_TakeInventory("StopDualWield",1)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
		
	FinishReloadRight:	//Weapon is fully loaded. Time to play the reloading animation.
		//TNT1 A 0 A_GiveInventory("LeftSMGAmmo", 40)
		TNT1 A 0 A_GiveInventory("BDSMGAmmo", 40)
		TNT1 A 5
		TNT1 A 0 A_PlaySound("SMGMOUT", 1)//reload sound
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
		TNT1 A 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)
		SMGR A 0 A_JumpIfInventory("IsPaladin",1,"PallyReloadAnimROnly")	
		SMGR A 0 A_JumpIfInventory("IsSorcerer",1,"SorcyReloadAnimROnly")
		SMGR A 0
		SMGR ABCCDDEEFFGH 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)
        SMGR IIIIJKLMNOPQRST 1
		Goto ReloadAnimROnlyEnded
		
		PallyReloadAnimROnly:
		PSRR GHIJKLMNOPQRSTUVWXYZ 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)
		PSRL ABCDEFGHIJKL 1
		Goto ReloadAnimROnlyEnded
		
		SorcyReloadAnimROnly:
		SMGR ABCCDDEEFFGH 1
		TNT1 A 0 A_PlaySound("SMGMAGIN", 1)
        SMGR IIIIJKLMNOPQRST 1
		
		ReloadAnimROnlyEnded:
		
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
		TNT1 A 0 A_TakeInventory("FiredSecondary", 1)
		TNT1 A 5
		TNT1 A 0 A_TakeInventory("Reloading")//Always put this to make sure that the game understand that you already are reloading your weapon, and calling this state again is not necessary
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_Takeinventory("HasUnloaded",1)
		Goto ReadyToFire		
				
		
			PaladinReload:
		P2RR ABCDDDDDDEFGHIIJJKLMNO 2
		TNT1 A 10
		TNT1 A 0 A_PlaySound("RELOAD", 1)//reload sound
		TNT1 A 0 A_JumpIfInventory("HasUnloaded", 1, 2)
		TNT1 A 0 A_FireCustomMissile("EmptyClipSpawn",-5,0,8,-4)
		P2RL ABCDDDDDDEFGHIIJJKLMNO 2
		Goto FinishReloadContinue
		
		Goto StopSprint
		
	DoKick:
	    TNT1 A 0
		TNT1 A 0 A_SetCrosshair(41)
		TNT1 AA 1 A_JumpIfInventory("GoFatality", 1, "GoingToReady")
		TNT1 A 0 A_Takeinventory("HasPlasmaWeapon",1)
		TNT1 A 0 A_TAkeinventory("HasCutingWeapon",1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_Takeinventory("PowerLightAmp",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		TNT1 A 0 A_JumpIfInventory("IsCrouching", 1, "SlideAttack")
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		K1CK A 0 A_JumpIfInventory("IsPaladin",1,3)
		K2CK A 0 A_JumpIfInventory("IsSorcerer",1,2)
		KICK A 0
		"####" BCD 1
		"####" A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        "####" H 5 A_Takeinventory("Kicking",1)
		"####" IGF 1
		"####" A 0 A_Takeinventory("Kicking",1)
		"####" EDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "GoingToReady")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"KickRight")
		Goto ReadyToFire
	
	
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		K1CK A 0 A_JumpIfInventory("IsPaladin",1,3)
		K2CK A 0 A_JumpIfInventory("IsSorcerer",1,2)
		KICK A 0
		
		"####" BCD 1
        "####" A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        "####" H 5 A_Takeinventory("Kicking",1)
		"####" IGF 1
		"####" A 0 
		"####" EDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "GoingToReady")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"KickRight")
		Goto ReadyToFire
	
	KickRight:
		K1K2 A 0 A_JumpIfInventory("IsPaladin",1,3)
		K2K2 A 0 A_JumpIfInventory("IsSorcerer",1,2)
		KIK2 A 1 A_Giveinventory("Kicking",1)
		"####" ABC 1
        "####" A 0 A_PlaySound("KICK")
		"####" A 0 
		"####" A 0 A_SetPitch(pitch-9)
		"####" A 0 A_SetAngle(angle+9)
		"####" A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
		"####" D 1
		"####" A 0 A_SetPitch(pitch+2)
		"####" A 0 A_SetAngle(angle-2)
		"####" D 1
		"####" A 0 A_SetPitch(pitch+2)
		"####" A 0 A_SetAngle(angle-2)
		"####" E 1 A_TakeInventory("Kicking",1)
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle-1)
		"####" E 1
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle-1)
		"####" C 1
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle-1)
		"####" B 2 
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle-1)
		"####" A 2 
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle-1)
		"####" A 2 
		"####" A 1 A_JumpIfInventory("Kicking",1,"AirKick")
		Goto ReadyToFire
	
	AirKick:
		TNT1 A 0
		K1CK J 0 A_JumpIfInventory("IsPaladin",1,3)
		K2CK J 0 A_JumpIfInventory("IsSorcerer",1,2)
		KICK J 1
	    "####" A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		"####" A 0 A_PlaySound("KICK")
		"####" A 0 A_Recoil (-15)
		"####" JKLMN 1
        "####" A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
		"####" A 0 
        "####" O 3
		"####" A 0 A_Takeinventory("Kicking",1)
		"####" PQ 2
		"####" RST 1 
		"####" A 0 A_JumpIfInventory("Kicking",1,"LeftFinishingKick")
		"####" A 0 A_JumpIfInventory("GoFatality", 1, "GoingToReady")
		"####" A 2 
		"####" A 1 A_JumpIfInventory("Kicking",1,"LeftFinishingKick")
		Goto ReadyToFire
		
	SuperAirKick:
		TNT1 A 0
		K1CK J 0 A_JumpIfInventory("IsPaladin",1,3)
		K2CK J 0 A_JumpIfInventory("IsSorcerer",1,2)
		KICK J 1
	    "####" A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		"####" A 0 A_PlaySound("KICK")
		"####" A 0 A_Recoil (-15)
		"####" JKLMN 1
        "####" A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        "####" O 3
		"####" A 0 A_Takeinventory("Kicking",1)
		"####" PQ 2
		"####" RST 1 
		"####" A 0 A_JumpIfInventory("GoFatality", 1, "GoingToReady")
		"####" A 2 
		"####" A 1 A_JumpIfInventory("Kicking",1,"LeftFinishingKick")
		Goto ReadyToFire
	
	SlideAttack:
		TNT1 A 0
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-16)
		TNT1 A 0 A_PlaySound("SlideKickStart", 5)
		S1DK A 0 A_JumpIfInventory("IsPaladin",1,3)
		S2DK A 0 A_JumpIfInventory("IsSorcerer",1,2)
		SLDK A 1
		"####" ABC 1
		"####" A 0 A_SetPItch(10)
        "####" A 0 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
        "####" E 1
		"####" A 0 A_Recoil (-14)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-12)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-8)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-6)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-4)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-4)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-3)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-3)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-3)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-2)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-1)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" F 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-1)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		Goto FinishSlide
		
		"####" G 1 A_FireCustomMissile("SlideAttack", 0, 0, 0, 10)
		"####" A 0 A_Recoil (-2)
		"####" A 0 A_SetPItch(10)
		"####" A 0 A_JumpIfInventory("KickHasHit", 1, "FinishSlideHitWall")
		"####" A 0 A_JumpIfInventory("IsCrouching", 1, 1)
		"####" A 0 A_TAkeInventory("KickHasHit", 1)
		Goto FinishSlide
		
		
	FinishSlide:	
		TNT1 A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0
		TNT1 A 0 A_PlaySound("SlideKickStop", 5)
		S1DK H 0 A_JumpIfInventory("IsPaladin",1,3)
		S2DK H 0 A_JumpIfInventory("IsSorcerer",1,2)
		SLDK H 1
		
		"####" HD 2 
		"####" A 0 SetPlayerProperty(0,0,0)
		"####" A 0 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
		"####" CBA 2 A_JumpIfInventory("Kicking", 1, "LeftFinishingKick")
		"####" A 0 A_JumpIfInventory("GoFatality", 1, "GoingToReady")
		"####" A 0 A_Takeinventory("Kicking",1)
		Goto ReadyToFire	
		
	FinishSlideHitwall:	
		TNT1 A 0
		S1DK H 0 A_JumpIfInventory("IsPaladin",1,3)
		S2DK H 0 A_JumpIfInventory("IsSorcerer",1,2)
		SLDK H 1
		"####" A 0 A_Stop
		"####" HDCBA 2
		"####" A 0 A_TAkeInventory("KickHasHit", 1)
		"####" A 0 A_JumpIfInventory("GoFatality", 1, "GoingToReady")
		"####" A 0 A_Takeinventory("Kicking",1)
		"####" A 0 SetPlayerProperty(0,0,0)
		Goto ReadyToFire		

	LeftFinishingKick:
		TNT1 A 0
		K1K3 A 0 A_JumpIfInventory("IsPaladin",1,3)
		K2K3 A 0 A_JumpIfInventory("IsSorcerer",1,2)
		KIK3 A 1
		"####" A 0 A_Recoil(-10)
		"####" ABC 1
        "####" A 0 A_PlaySound("KICK")
		"####" A 0 A_Giveinventory("Kicking",1)
		"####" A 0 A_SetPitch(pitch-9)
		"####" A 0 A_SetAngle(angle-9)
		"####" D 1 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
		"####" A 0 A_SetPitch(pitch+2)
		"####" A 0 A_SetAngle(angle+3)
		"####" E 1
		"####" A 0 A_SetPitch(pitch+2)
		"####" A 0 A_SetAngle(angle+3)
		"####" F 1 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle+3)
		"####" G 1 
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle+2)
		"####" H 1 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle+2)
		"####" I 1
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle+1)
		"####" J 1 A_FireCustomMissile("KickAttack", 0, 0, 0, 0)
		"####" A 0 A_SetPitch(pitch+1)
		"####" A 0 A_SetAngle(angle+1)
		"####" K 1
		TNT1 A 1 
		Goto ReadyToFire	
		
	Taunt:
		TNT1 A 0 A_Takeinventory("Taunting",1)
		Goto ReadyToFire
	Salute:
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		Goto ReadyToFire	
		
	Steady:
	TNT1 A 1
	Goto ReadyToFire	
		
		
	Unload:
		TNT1 A 1 A_WeaponReady(WRF_NOBOB)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo",1,3)
        Goto Ready
        
		
	RemoveBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("BDDualSMGAmmo",1,3)
		Goto FinishUnload
        TNT1 AAAAAA 0
		TNT1 A 0 A_Takeinventory("Clip1",1)
		TNT1 A 0 A_Takeinventory("BDDualSMGAmmo",1)
		TNT1 A 0 A_Takeinventory("LeftSMGAmmo",1)
		TNT1 A 0 A_Giveinventory("Clip1",1)
		Goto RemoveBullets
	
	FInishUnload:
		TNT1 AAA 0
		TNT1 A 0 A_GiveInventory("StopDualWield")
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_PlaySound("Reload")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Unloading",1)
		S2MG TSRQPONMLKJI 1
		SMGR TSRQPONMLKJI 1
		TNT1 A 0 A_GiveInventory("HasUnloaded", 1)
		TNT1 A 0 A_TakeInventory("StopDualWield")
		TNT1 A 0 A_Takeinventory("Unloading",1)
		Goto Ready+6
		
	}
}


/*ACTOR DoubleSMGAmmo : Ammo //Your weapon's magazine ammo.
{
   Inventory.Amount 0
   Inventory.MaxAmount 82 //Your weapon's magazine ammo limit. Always leave one more bullet, so you can do the 12+1 effect.
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 82
   Inventory.Icon "SMGPA0"
}*/


ACTOR LeftSMGAmmo : Ammo //Your weapon's magazine ammo.
{
   Inventory.Amount 0
   Inventory.MaxAmount 41 //Your weapon's magazine ammo limit. Always leave one more bullet, so you can do the 12+1 effect.
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 41
   Inventory.Icon SMGPA0
}

